/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package unc.pds.news;

import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Map;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.MapMessage;

/**
 *
 * @author ain
 */
public class NewsMessage implements MapMessage {

    public static String CONTEXT_ID_KEY = "context";
    public static String EVENT_NAME_KEY = "event";
    public static String ENTITY_ID_KEY = "entid";
    private Map properties;
    private String messageID;
    private long timestamp;
    private String myCorrelationID;
    private String myType = "MapMessage";
    private int myJMSDelivMode;
    private boolean isRedeliv;
    private long myJMSExp;
    private int myJMSPrior;
    private Destination myDestination;
    private Destination myreplyTo;

    public NewsMessage(){
        properties = new Hashtable();
    }
    public boolean getBoolean(String name) throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public byte getByte(String name) throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public short getShort(String name) throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public char getChar(String name) throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public int getInt(String name) throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public long getLong(String name) throws JMSException {
        return Long.parseLong((String)properties.get(name));
    }

    public float getFloat(String name) throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public double getDouble(String name) throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public String getString(String name) throws JMSException {
        return (String)properties.get(name);
    }

    public byte[] getBytes(String name) throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public Object getObject(String name) throws JMSException {
        return properties.get(name);
    }

    public Enumeration getMapNames() throws JMSException {
        return (Enumeration) properties.keySet().iterator();
    }

    public void setBoolean(String name, boolean value) throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void setByte(String name, byte value) throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void setShort(String name, short value) throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void setChar(String name, char value) throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void setInt(String name, int value) throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void setLong(String name, long value) throws JMSException {
        properties.put(name, (new Long(value)).toString());
    }

    public void setFloat(String name, float value) throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void setDouble(String name, double value) throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void setString(String name, String value) throws JMSException {
        properties.put(name, value);
    }

    public void setBytes(String name, byte[] value) throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void setBytes(String name, byte[] value, int offset, int length) throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void setObject(String name, Object value) throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public boolean itemExists(String name) throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public String getJMSMessageID() throws JMSException {
        return messageID;
    }

    public void setJMSMessageID(String id) throws JMSException {
        messageID = id;
    }

    public long getJMSTimestamp() throws JMSException {
        return timestamp;
    }

    public void setJMSTimestamp(long timestamp) throws JMSException {
        this.timestamp = timestamp;
    }

    public byte[] getJMSCorrelationIDAsBytes() throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void setJMSCorrelationIDAsBytes(byte[] correlationID) throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void setJMSCorrelationID(String correlationID) throws JMSException {
        myCorrelationID = correlationID;
    }

    public String getJMSCorrelationID() throws JMSException {
        return myCorrelationID;
    }

    public Destination getJMSReplyTo() throws JMSException {
        return myreplyTo;
    }

    public void setJMSReplyTo(Destination replyTo) throws JMSException {
        myreplyTo = replyTo;
    }

    public Destination getJMSDestination() throws JMSException {
        return myDestination;
    }

    public void setJMSDestination(Destination destination) throws JMSException {
        myDestination = destination;
    }

    public int getJMSDeliveryMode() throws JMSException {
        return myJMSDelivMode;
    }

    public void setJMSDeliveryMode(int deliveryMode) throws JMSException {
        myJMSDelivMode = deliveryMode;
    }

    public boolean getJMSRedelivered() throws JMSException {
        return isRedeliv;
    }

    public void setJMSRedelivered(boolean redelivered) throws JMSException {
        isRedeliv = redelivered;
    }

    public String getJMSType() throws JMSException {
        return myType;
    }

    public void setJMSType(String type) throws JMSException {
        myType = type;
    }

    public long getJMSExpiration() throws JMSException {
        return myJMSExp;
    }

    public void setJMSExpiration(long expiration) throws JMSException {
        myJMSExp = expiration;
    }

    public int getJMSPriority() throws JMSException {
        return myJMSPrior;
    }

    public void setJMSPriority(int priority) throws JMSException {
        myJMSPrior = priority;
    }

    public void clearProperties() throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public boolean propertyExists(String name) throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public boolean getBooleanProperty(String name) throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public byte getByteProperty(String name) throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public short getShortProperty(String name) throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public int getIntProperty(String name) throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public long getLongProperty(String name) throws JMSException {
        return Long.parseLong((String)properties.get(name));
    }

    public float getFloatProperty(String name) throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public double getDoubleProperty(String name) throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public String getStringProperty(String name) throws JMSException {
        return (String)properties.get(name);
    }

    public Object getObjectProperty(String name) throws JMSException {
        return properties.get(name);
    }

    public Enumeration getPropertyNames() throws JMSException {
        return (Enumeration) properties.keySet().iterator();
    }

    public void setBooleanProperty(String name, boolean value) throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void setByteProperty(String name, byte value) throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void setShortProperty(String name, short value) throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void setIntProperty(String name, int value) throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void setLongProperty(String name, long value) throws JMSException {
        properties.put(name, (new Long(value)).toString());
    }

    public void setFloatProperty(String name, float value) throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void setDoubleProperty(String name, double value) throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void setStringProperty(String name, String value) throws JMSException {
        properties.put(name, value);
    }

    public void setObjectProperty(String name, Object value) throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void acknowledge() throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void clearBody() throws JMSException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

}
